----------------------------------------------------------------------------------
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figure6.log
  log type:  text
 opened on:   3 Dec 2023, 18:09:14

. 
. version 16      

. 
. use "$data/ctctaxsim_mar1kid1.dta", clear

. append using "$data/ctctaxsim_mar1kid2.dta"
(label YEAR already defined)

. append using "$data/ctctaxsim_mar1kid3.dta"
(label YEAR already defined)

. tab depx

       depx |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     20,000       33.33       33.33
          2 |     20,000       33.33       66.67
          3 |     20,000       33.33      100.00
------------+-----------------------------------
      Total |     60,000      100.00

. 
. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000      49.995    28.86775          0      99.99
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1.601453    2.071323          0      6.431
      totctc |     60,000    2.518628    1.614441          0          6

. replace earnings=earnings*1000
(59,994 real changes made)

. replace ctc=ctc*1000
(60,000 real changes made)

. replace v25=v25*1000
(30,208 real changes made)

. replace totctc=totctc*1000
(58,344 real changes made)

. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000   -902.5994    4682.152    -9708.5     9338.5
    earnings |     60,000       49995    28867.75          0      99990
fedtaxless~c |     60,000    1616.028    4785.037      -6431    10338.5
         v25 |     60,000    1601.453    2071.323          0       6431
      totctc |     60,000    2518.628    1614.441          0       6000

. 
. gen avgtaxrate=fiitax/earnings
(6 missing values generated)

. gen avgtaxrate2021=fedtaxlessctc/earnings       
(6 missing values generated)

. 
. gen avgtaxeitc=-v25/earnings
(6 missing values generated)

. gen avgtaxctc=-totctc/earnings
(6 missing values generated)

. gen avgtaxctc2021=0

. 
. gen avgtaxeitcctc=avgtaxeitc+avgtaxctc
(6 missing values generated)

. 
. gen avginctax=avgtaxrate- avgtaxeitcctc
(6 missing values generated)

. 
. tab year avginctax if earnings==40000 & depx==1

    census |       avginctax
      year |   .037875        .04 |     Total
-----------+----------------------+----------
      2017 |         1          0 |         1 
      2018 |         0          1 |         1 
-----------+----------------------+----------
     Total |         1          1 |         2 

. replace avginctax=avginctax*.04/.037875 if year==2017
(23,260 real changes made)

. tab year avginctax if earnings==40000 & depx==1

    census | avginctax
      year |       .04 |     Total
-----------+-----------+----------
      2017 |         1 |         1 
      2018 |         1 |         1 
-----------+-----------+----------
     Total |         2 |         2 

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=-`var'
  3. }
(30,208 real changes made)
(58,344 real changes made)
(0 real changes made)
(47,588 real changes made)

. 
. foreach var in avgtaxeitc avgtaxctc avgtaxctc2021 avginctax{
  2.         replace `var'=`var'+1
  3. }
(59,994 real changes made)
(59,994 real changes made)
(60,000 real changes made)
(59,994 real changes made)

. 
. bysort earnings depx: egen minavgtax=min(avgtaxrate)
(6 missing values generated)

. gen difavgtax2=avgtaxrate2021-minavgtax
(6 missing values generated)

. sum difavgtax2

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  difavgtax2 |     59,994    .0755276    .0367987          0   .1590164

. 
. bysort earnings depx: egen maxavgtax=max(avgtaxrate)
(6 missing values generated)

. gen difavgtax=avgtaxrate2021-maxavgtax
(6 missing values generated)

. sum difavgtax

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   difavgtax |     59,994     .047224    .0350058  -.0060076   .1304348

. 
. gen difavgtax3=minavgtax-maxavgtax
(6 missing values generated)

. 
. sort earnings depx year 

. order year earnings depx *avgtax* dif*

. drop if year==2017
(30,000 observations deleted)

. replace difavgtax3=-difavgtax3
(29,247 real changes made)

. 
. *** create avg tax rates by $5000 bin x #kids to merge into income dist
. gen inccat=.
(30,000 missing values generated)

. forvalues i=5000(5000)100000{
  2.         replace inccat=`i' if earnings>`i'-5000 & earnings<=`i'
  3. }
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,497 real changes made)

.         
. bysort inccat depx year: egen avgtax = mean(difavgtax2)
(3 missing values generated)

. replace difavgtax2=-difavgtax2
(29,247 real changes made)

. 
. sort earnings depx

. twoway line difavgtax2 earnings if year==2018 & depx==1, lp(-) pstyle(p1) || lin
> e difavgtax2 earnings if year==2018 & depx==2, lp(_) pstyle(p2) || line difavgta
> x2 earnings if year==2018 & depx==3, pstyle(p3) graphregion(color(white)) bgcolo
> r(white) leg(order(1 "1 Kid" 2 "2 Kids" 3 "3 Kids") c(1) pos(5) ring(0)) ytitle(
> "Change in Return to Work") xtitle("Earnings" "{bf:Panel A: Married Parent Famil
> y}") ylabel(0 "0%" -.05 "-5%" -.1 "-10%" -.15 "-15%" -.2 " ") 

. graph save "$output/avgtaxinccatmar.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtaxinccatmar.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtaxinccatmar.gph saved

. 
. 
. use "$data/ctctaxsim_mar0kid1.dta", clear

. append using "$data/ctctaxsim_mar0kid2.dta"
(label YEAR already defined)

. append using "$data/ctctaxsim_mar0kid3.dta"
(label YEAR already defined)

. tab depx

       depx |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |     20,000       33.33       33.33
          2 |     20,000       33.33       66.67
          3 |     20,000       33.33      100.00
------------+-----------------------------------
      Total |     60,000      100.00

. 
. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000    623.6428    5520.775      -8855    14887.5
    earnings |     60,000      49.995    28.86775          0      99.99
fedtaxless~c |     60,000    3101.485    5519.867      -6431    14887.5
         v25 |     60,000    1.310576    1.883699          0      6.431
      totctc |     60,000    2.477842    1.684404          0          6

. replace earnings=earnings*1000
(59,994 real changes made)

. replace ctc=ctc*1000
(60,000 real changes made)

. replace v25=v25*1000
(26,824 real changes made)

. replace totctc=totctc*1000
(57,844 real changes made)

. sum fiitax earnings fedtaxlessctc v25 totctc

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
      fiitax |     60,000    623.6428    5520.775      -8855    14887.5
    earnings |     60,000       49995    28867.75          0      99990
fedtaxless~c |     60,000    3101.485    5519.867      -6431    14887.5
         v25 |     60,000    1310.576    1883.699          0       6431
      totctc |     60,000    2477.842    1684.404          0       6000

. 
. gen avgtaxrate=fiitax/earnings
(6 missing values generated)

. gen avgtaxrate2021=fedtaxlessctc/earnings       
(6 missing values generated)

. 
. gen avgtaxeitc=-v25/earnings
(6 missing values generated)

. gen avgtaxctc=-totctc/earnings
(6 missing values generated)

. gen avgtaxctc2021=0

. 
. gen avgtaxeitcctc=avgtaxeitc+avgtaxctc
(6 missing values generated)

. 
. gen avginctax=avgtaxrate- avgtaxeitcctc
(6 missing values generated)

. 
. bysort depx: sum avgtax*

----------------------------------------------------------------------------------
-> depx = 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  avgtaxrate |     19,998   -.0384978    .1771239  -.4531434   .1488899
avgtaxr~2021 |     19,998    -.001552    .1565695       -.34   .1488899
  avgtaxeitc |     19,998   -.0699848    .1169049       -.34          0
   avgtaxctc |     19,998   -.0369458    .0281865  -.1183009          0
avgtaxc~2021 |     20,000           0           0          0          0
-------------+---------------------------------------------------------
avgtaxeitc~c |     19,998   -.1069306    .1362064  -.4531434          0

----------------------------------------------------------------------------------
-> depx = 2

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  avgtaxrate |     19,998   -.1015125     .212742  -.5237579   .1312581
avgtaxr~2021 |     19,998   -.0376969    .1902841        -.4   .1387639
  avgtaxeitc |     19,998   -.1009697    .1511096        -.4          0
   avgtaxctc |     19,998   -.0638156    .0382265  -.1472367          0
avgtaxc~2021 |     20,000           0           0          0          0
-------------+---------------------------------------------------------
avgtaxeitc~c |     19,998   -.1647852    .1724027  -.5237579  -.0075058

----------------------------------------------------------------------------------
-> depx = 3

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  avgtaxrate |     19,998   -.1426713    .2231151  -.5737579   .1111311
avgtaxr~2021 |     19,998   -.0578323    .2067233       -.45   .1286379
  avgtaxeitc |     19,998   -.1165602     .169402       -.45          0
   avgtaxctc |     19,998   -.0848389    .0436732  -.1786885          0
avgtaxc~2021 |     20,000           0           0          0          0
-------------+---------------------------------------------------------
avgtaxeitc~c |     19,998   -.2013992    .1846266  -.5737579  -.0175068


. 
. tab year avginctax if earnings==40000 & depx==1

    census |       avginctax
      year |     .0592    .067875 |     Total
-----------+----------------------+----------
      2017 |         0          1 |         1 
      2018 |         1          0 |         1 
-----------+----------------------+----------
     Total |         1          1 |         2 

. replace avginctax=avginctax*.04/.037875 if year==2017
(24,951 real changes made)

. tab year avginctax if earnings==40000 & depx==1

    census |       avginctax
      year |     .0592   .0716832 |     Total
-----------+----------------------+----------
      2017 |         0          1 |         1 
      2018 |         1          0 |         1 
-----------+----------------------+----------
     Total |         1          1 |         2 

. 
. bysort earnings depx: egen minavgtax=min(avgtaxrate)
(6 missing values generated)

. gen difavgtax2=avgtaxrate2021-minavgtax
(6 missing values generated)

. sum difavgtax2

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
  difavgtax2 |     59,994    .0798906    .0388303          0   .1786885

. 
. bysort earnings depx: egen maxavgtax=max(avgtaxrate)
(6 missing values generated)

. gen difavgtax=avgtaxrate2021-maxavgtax
(6 missing values generated)

. sum difavgtax

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   difavgtax |     59,994    .0438429    .0384686  -.0230193   .1443304

. 
. gen difavgtax3=minavgtax-maxavgtax
(6 missing values generated)

. drop if year==2017
(30,000 observations deleted)

. foreach var in difavgtax2 difavgtax difavgtax3{
  2.         replace `var'=-`var'
  3. }
(29,247 real changes made)
(29,100 real changes made)
(29,247 real changes made)

. *** create avg tax rates by $5000 bin x #kids to merge into income dist
. gen inccat=.
(30,000 missing values generated)

. forvalues i=5000(5000)100000{
  2.         replace inccat=`i' if earnings>`i'-5000 & earnings<=`i'
  3. }
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,500 real changes made)
(1,497 real changes made)

.         
. bysort inccat depx year: egen avgtax = mean(difavgtax2)
(3 missing values generated)

. 
. sort earnings depx

. twoway line difavgtax2 earnings if year==2018 & depx==1, lp(-) pstyle(p1) || lin
> e difavgtax2 earnings if year==2018 & depx==2, lp(_) pstyle(p2) || line difavgta
> x2 earnings if year==2018 & depx==3, pstyle(p3) graphregion(color(white)) bgcolo
> r(white) leg(order(1 "1 Kid" 2 "2 Kids" 3 "3 Kids") c(1) pos(5) ring(0)) ytitle(
> "Change in Average Tax Rate") xtitle("Earnings" "{bf:Panel B: Unmarried Parent F
> amily}") ylabel(0 "0%" -.05 "-5%" -.1 "-10%" -.15 "-15%" -.2 " ") 

. graph save "$output/avgtaxinccatunmar.gph", replace
(file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/avgtaxinccatunmar.gph not found)
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication files/out
> put/avgtaxinccatunmar.gph saved

. 
. keep avgtax depx inccat

. rename depx calckids

. duplicates drop

Duplicates in terms of all variables

(29,937 observations deleted)

. unique calckids inccat
Number of unique values of calckids inccat is  63
Number of records is  63

. replace inccat=inccat/1000
(60 real changes made)

. gen married=0

. 
. graph combine "$output/avgtaxinccatmar.gph" "$output/avgtaxinccatunmar.gph" ,gra
> phregion(color(white)) 

. graph export "$output/figure6.png", replace
file G:\My Drive\Research\CTC expansion\submission\ntj\stata replication
    files/output/figure6.png saved as PNG format

. 
. erase "$output/avgtaxinccatmar.gph" 

. erase "$output/avgtaxinccatunmar.gph"

. 
. log close
      name:  <unnamed>
       log:  G:\My Drive\Research\CTC expansion\submission\ntj\stata replication f
> iles/output/figure6.log
  log type:  text
 closed on:   3 Dec 2023, 18:09:18
----------------------------------------------------------------------------------
